import urllib.request
from urllib.parse import urlencode
import re
def sv(s1,s2):
    a=''
    for i in range(0,15):
        if s1[i]==s2[i]:a+=s1[i]
        else:a+='0'
    return a
l=[]
for i in range(0,10):l.append(i)
for i in range(ord('A'),ord('Z')+1):l.append(chr(i))
res=open('n571.html','a',encoding='utf-8')
for i in l:
    link="http://zenitbet.com/toto/cardsall/?id=571&page="+str(i)
    f=urllib.request.urlopen(link)
    s=f.read()
    #print('*')
    s=re.search('<table class="toto-table toto-table_cards">.+</table>',str(s)).group(0)
    res.write(str(s))
res.close()

    
